<!--
 * @Author: richarfang
 * @Date: 2021-03-23 15:42:56
 * @LastEditTime: 2021-05-17 18:24:50
 * @LastEditors: richarfang
 * @Description: 购物车商品组件
-->

<template>
    <div class="goods-area">
      <goods-card v-model="goodsInfo.count" :hasSvip="goodsInfo.hasSvip" :key="goodsInfo.id" :goodsInfo="goodsInfo"
        :showStepper="false" :goodsTagList="goodsTagList">
      </goods-card>
    </div>
  </template>
  
  <script>
  import GoodsCard from "../GoodsCard";
  export default {
    props: {
      goodsInfo: {
        type: Object,
        default: () => { },
      },
    },
    data() {
      return {
        showSkuCard: false,
        skuCount: null,
        attrList: [],
        skuList: [],
      };
    },
    components: {
      GoodsCard,
    },
    computed: {
      disabledGoods() {
        return this.goodsInfo.stock === 0;
      },
      goodsTagList() {
        let goodsTagList = [];
        if (this.goodsInfo.isTeam) {
          goodsTagList.push("拼团");
        }
  
        if (this.goodsInfo.activity_type === 3) {
          goodsTagList.push("限时折扣");
        }
        return goodsTagList;
      },
    },
    methods: {},
  };
  </script>
  
  <style lang="scss" scoped>
  .goods-area:not(:last-of-type) {
    padding-bottom: .24rem;
    border-bottom: 1px solid #f7f7f7;
  }
  
  .goods-area {
    padding-top: .24rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  
  .button-delete {
    display: flex;
    margin-left: 0.32rem;
    width: 1.28rem;
    height: 100%;
    justify-content: center;
    align-items: center;
    color: white;
    background: #ff4747;
  }
  </style>
  